﻿<UserControl x:Class="VMuktiGrid.CustomGrid.ctlGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    VerticalAlignment="Top" HorizontalAlignment="Stretch"
    x:Name="CtlGrid" Height="Auto" Width="Auto">

    <Grid Background="White" Name="DocumentRoot" HorizontalAlignment="Stretch" Grid.Row="1" VerticalAlignment="Stretch" SizeChanged="DocumentRoot_SizeChanged" >
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*" MinWidth="50"/>
			<ColumnDefinition Width="*" MinWidth="50"/>
            <ColumnDefinition Width="*" MinWidth="50"/>
		</Grid.ColumnDefinitions>
		
		<Grid.RowDefinitions>
			<RowDefinition/>
		</Grid.RowDefinitions>

        <ItemsControl Background="Transparent" Width="Auto" Height="Auto" VerticalAlignment="Stretch" 
                      MinWidth="50" MinHeight="500" Grid.Column="0" x:Name="LeftPanelContainer"
                      RenderTransformOrigin="0.5,0.5" Padding="2,2,2,2">
		</ItemsControl>

		<ItemsControl Background="Transparent" Width="Auto" Height="Auto" VerticalAlignment="Stretch" 
                      MinWidth="50" MinHeight="500" Grid.Column="1" x:Name="CentralPanelContainer"  
                      RenderTransformOrigin="0.5,0.5" Padding="6,2,2,2">
		</ItemsControl>

		<ItemsControl Background="Transparent" Width="Auto" Height="Auto" VerticalAlignment="Stretch" 
                      MinWidth="50" MinHeight="500" Grid.Column="2" x:Name="RightPanelContainer" 
                      RenderTransformOrigin="0.5,0.5" Padding="6,2,2,2">
		</ItemsControl>

        <GridSplitter Focusable="False" Width="4" VerticalAlignment="Top" Height="75" HorizontalAlignment="Left" Background="LightGray" 
                      Grid.Column="1" MinHeight="0" x:Name="LeftSplitter" ResizeBehavior="BasedOnAlignment" >
            <GridSplitter.Triggers>
                <EventTrigger RoutedEvent="Mouse.MouseEnter">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard Storyboard.TargetName="LeftSplitter" Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)">
                                <ColorAnimation To="Gray" Duration="00:00:00" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
                <EventTrigger RoutedEvent="Mouse.MouseLeave">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard Storyboard.TargetName="LeftSplitter" Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)">
                                <ColorAnimation To="LightGray" Duration="00:00:00" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
            </GridSplitter.Triggers>
        </GridSplitter>
        
        <GridSplitter Focusable="False" Width="4" HorizontalAlignment="Left" Background="LightGray" VerticalAlignment="Top" Height="75"
                      Grid.Column="2" MinHeight="0" x:Name="RightSplitter" ResizeBehavior="BasedOnAlignment">
            <GridSplitter.Triggers>
                <EventTrigger RoutedEvent="Mouse.MouseEnter">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard Storyboard.TargetName="RightSplitter" Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)">
                                <ColorAnimation To="Gray" Duration="00:00:00" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
                <EventTrigger RoutedEvent="Mouse.MouseLeave">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard Storyboard.TargetName="RightSplitter" Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)">
                                <ColorAnimation To="LightGray" Duration="00:00:00" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
            </GridSplitter.Triggers>
        </GridSplitter>

    </Grid>
</UserControl>
